home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
os2
/
commo70.zip
/
MOSTHOST.MAC
< prev
next >
Wrap
Text File
|
1996-08-24
|
25KB
|
770 lines
MOSTHOST.MAC (Regular version)
by Shad Muegge and Fred Brucker
{:setup} * Set up MOSTHOST options
-------------------------------------------------------------------------------
-Configuration Items--------------Description----------------------------------
-------------------------------------------------------------------------------
{LIGH Y} Modem signal lights
{SETV dospassword,PASSWORD} Password to access the DOS menu
{SETV filedir,%_hom%MHFILE\} Directory for file transfer files
{SETV datadir,%_hom%MHDATA\} Directory for user data file
{SETV hotkeys,n} Hot keys (y/n)
{SETV inact_time,120} Inactivity timer, seconds
{SETV ring_string,RING} String sent from modem to indicate a ring
{SETV connect_string,CONNECT} Result string for a successful connection
-------------------------------------------------------------------------------
{SETV pr_alarm,0} * Turn off protocol alarms
{SETG %inact_time,time_out} * Set up GETString timer
{RTRA y,9,0} * Filter tabs from input
{CLEA}
{PARM ,,,A}
{SPOC y}
{LOCA y}
{SETE WF3}
{RETURN}
--------------------------------------------* General functions ---------------
{:cls} * Clear the screen
{SEND ^L}
{RETURN}
{:press_any_key} * Pause until a key is pressed
{SEND ^J^MPress Any Key:}
{GETS-H temp,1,PK}
{:PK} {setv temp}
{SEND ^J^M}
{RETURN}
{:dsp_file} * Display a file
{IFEX %dump_file,,DF5} * IN: %dump_file
{SETV count,0}
{ROPE %dump_file,DF3}
{:DF1} {READ dline}
{SEND ^M%dline^J^M}
{INCR count}
{COMP count,23} {IFCO DF4}
{GOTO DF1}
{:DF2} {RCLOSE}
{:DF3} {SETV dline}
{SETV ch}
{SETV count}
{RETURN}
{:DF4} {SETV count,0}
{SEND ^MMore [Y],N,C: }
{CALL get_key}
{IFCO DF1}
{COMP ch,n} {IFCO DF2}
{COMP ch,y} {IFCO DF1}
{COMP ch,c} {IFCO ,DF4}
{SETV count,26}
{GOTO DF1}
{:DF5} {SEND ^J^M^GError: File not found: %dump_file}
{CALL press_any_key}
{RETURN}
{:menu} * Get menu selection
{SEND %prompt [%_tim]: } * OUT: %ch
{CALL get_key} * %ch = ~, if user hit CR at prompt
{IFCO MN1}
{SEND ^J^M}
{COMP ch,*} {IFCO time_out}
{GOTO MN2}
{:MN1} {SETV ch,~}
{SEND ^J^M}
{:MN2} {RETURN}
{:get_key}
{COMP hotkeys,y} {IFCO GK1}
{GETS ch,1}
{GOTO GK2}
{:GK1} {GETS-H ch,1}
{:GK2} {COMP ch}
{RETURN}
{:get_protocol} * Get protcol selection
{PAUS-T 2}
{CALL cls} * OUT: %protocol
{SEND ┌───────────────────────────────────────────────────┐^J^M}
{SEND │ Protocols │^J^M}
{SEND └───────────────────────────────────────────────────┘^J^M}
{SEND [Y] Ymodem^J^M}
{SEND [G] Ymodem-G^J^M}
{SEND [X] Xmodem^J^M}
{SEND [Z] Zmodem^J^M}
{SEND [H] HS/Link^J^M^J^M}
{SETV prompt,Protocol:}
{CALL menu}
{COMP ch,~} {IFCO PG2}
{COMP ch,z} {IFCO PG1}
{COMP ch,y} {IFCO PG1}
{COMP ch,g} {IFCO PG1}
{COMP ch,x} {IFCO PG1}
{COMP ch,h} {IFCO ,PG2}
{:PG1} {SETV protocol,%ch}
{:PG2} {RETURN}
{:send_hslink} * HSLINK download subroutine
{SEND ^J^MStart your HS/Link download now.^J^M}
{CALL h_send}
{COMP %_err,0}
{RETURN}
{:send_zmodem} * ZMODEM download subroutine
{SEND ^J^MStart your Zmodem download now.^J^M}
{CALL z_send}
{COMP %_err,0}
{RETURN}
{:send_ymodem} * YMODEM download subroutine
{SEND ^J^MStart your Ymodem download now.^J^M}
{CALL yb_send}
{COMP %_err,0}
{RETURN}
{:send_xmodem} * XMODEM-1K download subroutine
{SEND ^J^MStart your Xmodem download now.^J^M}
{IFEX %pr_file,,SX1}
{CALL xk_send}
{COMP %_err,0}
{:SX1} {RETURN}
{:recv_hslink} * HSLINK upload subroutine
{SEND ^J^MStart your HS/Link upload now.^J^M}
{CALL h_recv}
{COMP %_err,0}
{RETURN}
{:recv_zmodem} * ZMODEM upload subroutine
{SEND ^J^MStart your Zmodem upload now.^J^M}
{CALL z_recv}
{COMP %_err,0}
{RETURN}
{:recv_ymodem} * YMODEM upload subroutine
{SEND ^J^MStart your Ymodem upload now.^J^M}
{CALL yb_recv}
{COMP %_err,0}
{RETURN}
{:recv_yg} * YMODEM-G upload subroutine
{SEND ^J^MStart your Ymodem-G upload now.^J^M}
{CALL yg_recv}
{COMP %_err,0}
{RETURN}
{:recv_xmodem} * XMODEM-1K upload subroutine
{SEND ^J^MStart your Xmodem upload now.^J^M}
{CALL xc_recv}
{COMP %_err,0}
{RETURN}
{:transfer_file} * Transfer a file upload & download
{PUSH DL2}
{COMP proto,sz} {IFCO send_zmodem} * IN: %proto
{COMP proto,sy} {IFCO send_ymodem} * s + %protocol for downloads
{COMP proto,sg} {IFCO send_ymodem} * r + %protocol for uploads
{COMP proto,sx} {IFCO send_xmodem}
{COMP proto,sh} {IFCO send_hslink}
{COMP proto,rz} {IFCO recv_zmodem}
{COMP proto,ry} {IFCO recv_ymodem}
{COMP proto,rg} {IFCO recv_yg}
{COMP proto,rx} {IFCO recv_xmodem}
{COMP proto,rh} {IFCO recv_hslink}
{SEND ^J^MInvalid protocol ^J^M}
{CALL press_any_key}
{COMP proto,sz} * Set a bad condition for return
{:DL1} {SETV proto}
{POPS}
{RETURN}
{:DL2} {PAUS 2}
{RETURN}
{:get_name}
{SEND ^J^J^MEnter your name: } * Get a name from user
{GETS lname} * OUT: %lname
{COMP lname} * OUT: cond. flag set if null
{RETURN}
{:get_password} * Get a password
{GETS-P pass}
{RETURN}
{:time_out} * Time out user
{POPS-C} * Clear the stack
{GOTO GBY}
{:write_user} * Update user record in user file
{ROPE %datadir%USER.MHS,WU3}
{WOPE %datadir%$$$TEMP.MHS}
{:WU1} {CALL read_rec}
{COMP login_name,%u_temp1}
{IFCO WU2}
{CALL write_rec}
{GOTO WU1}
{:WU2} {CALL user_temp}
{CALL write_rec}
{GOTO WU1}
{:WU3} {POPS} ** pop read_rec return addr
{WCLO}
{EXEC-N del %datadir%USER.MHS}
{EXEC-N ren %datadir%$$$TEMP.MHS USER.MHS}
{SETV u_temp1}
{SETV u_temp2}
{SETV u_temp3}
{RETURN}
{:write_rec} * Write a user record
{WRIT %u_temp1} * IN: name
{WRIT %u_temp2} * IN: password
{WRIT %u_temp3} * IN: protocol
{RETURN}
{:read_user} * Read a user record
{IFEX %datadir%USER.MHS,,RU3} * IN: %login_name
{ROPE %datadir%USER.MHS,RU2}
{:RU1} {CALL read_rec}
{COMP lname,%u_temp1}